<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:f="http://tecnologie-web.studenti.math.unipd.it/tecweb/~ccardin/"
                exclude-result-prefixes="f">

<xsl:output method='xml' version='1.0' encoding='UTF-8' indent='yes' omit-xml-declaration='yes'/>

    <xsl:template match="f:faq">
            <div id="content-title">
                <h2>
                    <span>
                        <xsl:value-of select="f:title"/>
                    </span>
                    <xsl:value-of select="f:description"/>
                </h2>
                    
                    <p>Updated at: <xsl:value-of select="concat(substring(f:updateDate,6,2),'/',substring(f:updateDate,9,2),'/',substring(f:updateDate,1,4))"/></p>
            </div>
            <div id="list-faq">
                <ul>
                    <xsl:for-each select="f:questions/f:category">                                                    
                        <li>
                            <a href="#{translate(f:comment, ' ','')}"><xsl:value-of select="f:comment"/></a>
                        </li>
                    </xsl:for-each>
                </ul>
            </div>

            <div id="content-faq">

                <xsl:for-each select="f:questions/f:category">
		<div class="category">
                    <h3 id="{translate(f:comment, ' ','')}" ><xsl:value-of select="f:comment"/></h3>
                    <xsl:for-each select="f:pair">
			<div class="pair">
                        <h4><xsl:value-of select="f:question"/></h4>
                        <p><xsl:apply-templates select="f:answer"/></p>
						<p class="to-top">
							 <a href="#content">Return to top</a><br/>
							 <a class="to-menu" href="#nav">Return to menu</a>
						</p>
			</div>
                    </xsl:for-each>
		</div>
                </xsl:for-each>
            </div>
    </xsl:template>
    
    <xsl:template match="f:answer">
            <xsl:apply-templates/>
    </xsl:template>
    
    <xsl:template match="f:answer//f:subtitle">
        <h3>
            <xsl:value-of select="." />
        </h3>
    </xsl:template>
    
    <xsl:template match="f:answer//f:faqImage">
        <p><img src="{f:path}" class="auralNotRead" alt="{f:imgDescription}" height="{@imgHeight}" width="{@imgWidth}" /></p>
    </xsl:template>
    
    <xsl:template match="f:answer//f:faqLink">
        <a href="{f:to}" title="{f:title}"><xsl:value-of select="f:text"/></a>
    </xsl:template>
    
    <xsl:template match="f:answer//text()">
        <xsl:copy-of select="." />
    </xsl:template>
    
    
</xsl:stylesheet>
